|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectga.core.validation.RuleValidator<T>
T - The generic type of individuals.public class RuleValidator<T extends IIndividual<T>>
Validator implementation that uses a set of rules.
| Field Summary | |
|---|---|
private static java.util.logging.Logger |
LOGGER
|
private java.util.List<IValidationRule<T>> |
mandatoryRules
These rules must match with mandatoryThreshold. |
private float |
mandatoryThreshold
|
private java.util.List<IValidationRule<T>> |
perfectionRules
These rules must match with perfectionThreshold. |
private float |
perfectionThreshold
|
private java.util.List<IValidationRule<T>> |
proposedRules
These rules must match with proposedThreshold. |
private float |
proposedThreshold
|
| Constructor Summary | |
|---|---|
RuleValidator()
|
|
| Method Summary | |
|---|---|
void |
addRule(IValidationRule<T> rule)
Adds a rule to the set of rules. |
boolean |
isValid(T individual,
GAContext context)
Validates an individual. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.logging.Logger LOGGER
private final java.util.List<IValidationRule<T extends IIndividual<T>>> mandatoryRules
mandatoryThreshold.
private final java.util.List<IValidationRule<T extends IIndividual<T>>> proposedRules
proposedThreshold.
private final java.util.List<IValidationRule<T extends IIndividual<T>>> perfectionRules
perfectionThreshold.
private final float mandatoryThreshold
private final float proposedThreshold
private final float perfectionThreshold
| Constructor Detail |
|---|
public RuleValidator()
| Method Detail |
|---|
public void addRule(IValidationRule<T> rule)
rule - Rule to add.
public boolean isValid(T individual,
GAContext context)
IValidator
isValid in interface IValidator<T extends IIndividual<T>>individual - The individual to test for being valid.context - The GA context.
true if the individual is valid, false otherwise.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||